FROM node:8.9.4-alpine

RUN apk --update add tzdata \
    && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    && echo "Asia/Shanghai" > /etc/timezone \
    && apk del tzdata

RUN mkdir -p /usr/src/app

WORKDIR /usr/src/app

# add npm package
COPY package.json /usr/src/app/package.json

RUN yarn install --production && yarn cache clean

# copy code
COPY . /usr/src/app

EXPOSE 3000

CMD [ "npm", "start" ]